package com.chixing.day02;

public class WhileDemo {
    public static void main(String[]args){
        //------------while---------------
        int i=0;
        int sum=0;
        while (i<=100){
            sum+=i;
            i++;
        }
        System.out.println("sum="+sum);



        //----------do-while(一定会至少执行一遍)-----------
        i=0;
        sum=0;
        do{
            sum+=i;
            i++;

        }while(i<=100);
        System.out.println(sum);

    }
}
